package com.byit.domain;

import java.io.Serializable;

import com.baomidou.mybatisplus.enums.IdType;

import java.util.Date;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 后台用户表
 * </p>
 *
 * @author wangx
 * @since 2018-12-11
 */
@Data
@TableName("sys_user")
public class SysUser extends Model<SysUser> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 登录账号
     */
    @TableField("login_name")
    private String loginName;
    /**
     * 登录密码
     */
    @TableField("password")
    private String password;
    /**
     * 用户真实姓名
     */
    @TableField("real_name")
    private String realName;
    /**
     * 部门ID
     */
    @TableField("dept_id")
    private Long deptId;
    /**
     * 用户类型 1系统用户 2机构用户
     */
    @TableField("user_type")
    private Integer userType;
    /**
     * 电话号码
     */
    @TableField("phone")
    private String phone;
    /**
     * 邮箱地址
     */
    @TableField("email")
    private String email;
    /**
     * 所属机构ID
     */
    @TableField("company_id")
    private Long companyId;
    /**
     * 头像
     */
    @TableField("icon")
    private String icon;
    /**
     * 是否是管理员 0否 1是
     */
    @TableField("is_manager")
    private Integer isManager;
    /**
     * 删除标志
     */
    @TableField("is_del")
    private Integer isDel;
    /**
     * 上级用户
     */
    @TableField("parent_id")
    private Long parentId;
    /**
     * 插入时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;
    /**
     * 账户状态  0禁用 1启用
     */
    @TableField("status")
    private Integer status;
    /**
     * 操作人Id
     */
    @TableField("operation_id")
    private Long operationId;

    @TableField(exist = false)
    private String roles;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "SysUser{" +
                ", id=" + id +
                ", loginName=" + loginName +
                ", password=" + password +
                ", realName=" + realName +
                ", deptId=" + deptId +
                ", userType=" + userType +
                ", phone=" + phone +
                ", email=" + email +
                ", companyId=" + companyId +
                ", icon=" + icon +
                ", isDel=" + isDel +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", status=" + status +
                ", operationId=" + operationId +
                "}";
    }
}
